/**
	@author Maciej Suminski
	@version 1.0

	Projekt VoD-ka
	Klasa obslugujaca protokol RTSP i dekodujaca MPEG. Zastosowano biblioteke FFmpeg <http://ffmpeg.org>
*/

#ifndef VIDEO_HPP
#define VIDEO_HPP

#include <string>

extern "C"
{
#include <stdint.h>
#include <stdio.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}

#include <wx/wx.h>
#include <wx/window.h>

using namespace std;

class Video {
public:
    Video(string address);
    ~Video();

    unsigned int getWidth();
    unsigned int getHeight();
    wxBitmap getFrame();
private:
    void decodeFrame();

    AVFormatContext *pFormatCtx;
    AVCodecContext* pCodecCtx;
    AVCodec* pCodec;
    AVFrame* pFrame;
    AVFrame* pFrameRGB;
    AVPacket packet;
    int videoStream;
    uint8_t* buffer;
    unsigned int width, height;
    struct SwsContext* pSWSContext;
};

#endif /* VIDEO_HPP */

